//
//  AppDelegate.m
//  MapDemo
//
//  Created by 王声远 on 15/8/23.
//  Copyright (c) 2015年 anody. All rights reserved.
//

#import "AppDelegate.h"
#import <MapKit/MapKit.h>

@interface AppDelegate ()<CLLocationManagerDelegate>

@property (nonatomic,strong) CLLocationManager *location;

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    _location = [[CLLocationManager alloc] init];
    _location.delegate= self;
    [_location requestAlwaysAuthorization];
    
    return YES;
}

- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
{
    switch (status) {
        case kCLAuthorizationStatusNotDetermined:
            if ([_location respondsToSelector:@selector(requestAlwaysAuthorization)]) {
                [_location requestAlwaysAuthorization];
            }
            break;
        default:
            break;
            
            
    } 
}

@end
